home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12249 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  39 lines

  1. Path: nntp.msstate.edu!phoenix!vkire
  2. From: vkire@ERC.MsState.Edu (Kiril Nikola Vidimce)
  3. Newsgroups: comp.lang.c++
  4. Subject: new and multidimensional arrays
  5. Date: 19 Mar 1996 01:32:29 GMT
  6. Organization: Mississippi State University
  7. Message-ID: <4il2rd$4fs@NNTP.MsState.Edu>
  8. NNTP-Posting-Host: phoenix.erc.msstate.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. if i have a method declared as:
  12.  
  13. setValues (int, int, float [][3])
  14.  
  15. how can i declare a dynamic array with new?
  16.  
  17. i tried:
  18.  
  19. float *variable[3];
  20.  
  21. for (i=0; i<size; i++)
  22.     variable [i] = new float [3];
  23.  
  24. but it doesnt work [the compiler says that there is no instance of
  25. the above method that accepts that kind of a parameter.
  26.  
  27. hints?
  28.  
  29. thanks,
  30. KV
  31. --
  32.  
  33.      +-------------------------------------------------------------+
  34.      | Kiril N. Vidimce, Comp.Sci.     -  "I hear and I forget,    |
  35.      | PO Box 3167, MS State, MS 39762 -  "I see and I remember,   | 
  36.      | vkire@erc.msstate.edu           -   I do and I understand." | 
  37.      | vkire@gtlug.org                 -         - Confucious      | 
  38.      + Cubicle #303 @ ERC -----------------------------------------+
  39.